package websocket.enum_;

public enum ComData {
    /**
     * 水平仪串口号
     */
    SHUI_PING_YI("SHUI_PING_YI", "COM3"),
    /**
     * 双轴转台串口号
     */
    SHUANG_ZHOU_ZHUAN_TAI_YI("SHUANG_ZHOU_ZHUAN_TAI_YI", "COM4"),
    /**
     * 航向串口号
     */
    HANG_XIANG("HANG_XIANG", "COM13");

    private String index;

    private String msg;

    ComData(String index, String msg) {
        this.index = index;
        this.msg = msg;
    }

    public static String getMsgByIndex(String index) {
        for (ComData item : ComData.values()) {
            if (item.index.equals(index)) {
                return item.msg;
            }
        }
        return null;
    }
}
